import sqlite3

def student_info_init():
    # 连接到数据库（如果不存在则创建）
    conn = sqlite3.connect('student_management.db')
    cursor = conn.cursor()

    cursor.execute('''
    CREATE TABLE IF NOT EXISTS student_info (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT NOT NULL,
        student_id TEXT NOT NULL UNIQUE,
        gender TEXT,
        ethnicity TEXT,
        class_info TEXT,
        major TEXT,
        dorm_building TEXT,
        dorm_num TEXT,
        photo BLOB
    )
    ''')

    conn.commit()
    conn.close()


if __name__ == "__main__":
    student_info_init()
    #log_init()
    print("学生信息表和日志操作表创建成功！")